
package com.zhu.storesmanager;


import com.baidu.mapapi.BMapManager;
import com.baidu.mapapi.MKEvent;
import com.baidu.mapapi.MKGeneralListener;
import android.app.Application;
import android.util.Log;

/**
 * Application 地图,URL 初始化  
 * 
 */

public class StoresManagerApplication extends Application {

    static public StoresManagerApplication mApplicaton;
    //static public String mStrKey = "3758B7D2F6251E6D997682DD70C6D9BD9B2DA4C0"; //Map key
    boolean m_bKeyRight = true;

    private BMapManager mBMapManager = null; //地图管理

    public static class MyGeneralListener implements MKGeneralListener {
        @Override
        public void onGetNetworkState(int iError) {
            Log.d("MyGeneralListener", "onGetNetworkState error is " + iError);
        }

        @Override
        public void onGetPermissionState(int iError) {
            if (iError == MKEvent.ERROR_PERMISSION_DENIED) {
            }
        }
    }

    @Override
    public void onCreate() {
        mApplicaton = this;
        //mBMapManager = new BMapManager(this);
        //mBMapManager.init(StoresManagerApplication.mStrKey, new StoresManagerApplication.MyGeneralListener());
        super.onCreate();
    }

    /**
     * 自定义IP登录
     */
    public void setWebUrl(String ip) {

    }

    public BMapManager getMapManager(){
        return mBMapManager;
    }

    @Override
    public void onTerminate() {
//        if (mBMapManager != null) {
//            mBMapManager.destroy();
//            mBMapManager = null;
//        }
        super.onTerminate();
    }
}
